package com.example.springbase.test.AutowireMode;

import com.example.springbase.test.ConditionalOnMissingBean.PersonMapper;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * ConfigurationTest
 *
 * @author zhouxianfeng
 * @date 2021-4-13
 */
@Import(MyImportRegistrar.class)
@Configuration
public class ConfigurationTest1 {

    @Bean
    @ConditionalOnMissingBean(PersonMapper.class)
    public PersonMapper p2Mapper() {
        return new PersonMapper("p2");
    }
}
